#-- 应用说明
#coding='utf-8'
#author: Terry
#Usage: "practice on tkinter"

#--


from tkinter import *

#创建主窗口
root_window=Tk()

#--美化窗口
root_window.title("Tk Demo App") #设置窗口标题
root_window.geometry("600x300") # 设置窗口大小
root_window['background']="#C0F0C0" # 设置背景色
root_window.iconbitmap('F:\\icons\\TheWorld.ico') #设置应用logo
root_window.resizable(1,1) #设置窗口可以拉伸


#-- 添加控件
# dev_language=["C","Java","Python","JavaScript","CSS","SQL"]

# # 向主窗口添加控件
# la=Listbox(root_window)
# #给控件添加内容
# for item in dev_language:
#     la.insert(0,item)


#添加文本输入框
la1=Label(text="请输入...")
txt_input=Text(root_window,width=50,height=2,undo=True,wrap="char",relief=SUNKEN,yscrollcommand=1,spacing1=5)

#添加应用按钮
btn_quit=Button(root_window,text="关闭",command=root_window.quit)
btn_speak=Button(root_window,text="朗读",command=None)
btn_select_file=Button(root_window,text="打开文件",command=None)
btn_savemp3=Button(root_window,text="保存成.mp3",command=None)

#添加说明文本
txt_introduce=Label(root_window,text="无声加油站欢迎您",bg="yellow",fg="red",font=('Times', 20, 'bold italic'))




#将控件组装到主窗口
#la.pack()
la1.pack(side="left")
txt_input.pack()
txt_introduce.pack(side="bottom")
btn_select_file.pack()
btn_speak.pack()
btn_savemp3.pack()
btn_quit.pack(side="bottom",after=btn_savemp3)


#窗口显示效果， normal--正常，icon--最下化，zoomed--最大化
# print("屏幕宽度：",root_window.winfo_screenwidth())
# print("屏幕高度：",root_window.winfo_screenheight())
txt_input.insert(INSERT, "please replace these with what you want to say hahahhahahahaha ahahha hahah ahahha ")
root_window.state("normal")

#刷新窗口 root_window.update()
#显示主窗口
root_window.mainloop()


